//years
$(document).ready(function(){
	var newSelect = $(".selectBoxValue");
	newSelect.click(function(e){
		if(this.className == "open"){
			closeSelect(this);
		}else{
			this.className = "open";
			$(this.nextSibling).slideDown("fast");
		}
		e.stopPropagation();
	});
	
	function closeSelect(obj){
		$(".open").parent().find("p").slideUp("fast",function(){
			$(".open").removeClass("open");
		});
	}

	$(document).bind("click", function() {
	  	closeSelect(newSelect[0]);
	});
	newSelect.next().click(function(e){
		var src = e.target;
		if(src.tagName == "A"){
			var PObj = src.parentNode;
			PObj.previousSibling.innerHTML = src.innerHTML;
			$(src).siblings().removeClass();
			src.className = "current";
			PObj.nextSibling.value = src.getAttribute("value");
		}
	});
	
	$(".woindShow ul li input[type=checkbox]").click(function(){
	   var showValue="";
	   $(".woindShow ul li input[type=checkbox]").each(function(){
			if($(this).attr("checked")){  
				showValue+="<li>"+$(this).attr("title")+"</li>";
			} 
		});
		$(".professionList ul").html(showValue);
	});
	
	
	$(".labeladdBtn").click(function(){
	    var textvalue=$("input[name=labeladd]").val();
	    if(textvalue.length>=1)
		{
			$(".tag ul").append('<li><a href="javascript:void()">'+textvalue+'</a><a class="close"  href="javascript:void()" ></a></li>');
			CloseLabel();
		}
	});
	CloseLabel();
	

	
});

function  CloseLabel(){
	$(".close").click(function(){
	    $(this).parent().remove();
	});
}
